<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<script src="/wondershare/js/products.js"></script>
<script src="/wondershare/js/task.js"></script> 
<script src="/wondershare/js/jquery.cvbox.min.js"></script> 
<script src="../../fckeditor/fckeditor.js"></script> 
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../images/unti.js"></script>
<title>产品<{$tile}>页</title>
<style type="text/css">
catListTag {DISPLAY: none}
.cvBoxShade {Z-INDEX: 2000; BACKGROUND: #ccc; LEFT: 0px; WIDTH: 100%; POSITION: absolute; TOP: 0px; HEIGHT: 0px}
.cvBoxBorder {BORDER-RIGHT: #000000 0px solid; PADDING-RIGHT: 8px; BORDER-TOP: #000000 0px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; Z-INDEX: 2000; PADDING-BOTTOM: 8px; BORDER-LEFT: #000000 0px solid; WIDTH: 100%; PADDING-TOP: 8px; BORDER-BOTTOM: #000000 0px solid; POSITION: absolute; BACKGROUND-COLOR: #ccc;}
.cvBoxBorder A {COLOR: #486aaa; TEXT-DECORATION: none}
.cvBoxBorder A:hover {COLOR: #c00; TEXT-DECORATION: none}
.cvBoxTitleBar {WIDTH: 100%; LINE-HEIGHT: 27px; HEIGHT: 26px; BACKGROUND-COLOR: #eeeeee}
.cvBoxTitleBarText {PADDING-LEFT: 10px; FONT-WEIGHT: bold; FLOAT: left; COLOR: #333}
.cvBoxTitleBarClose {PADDING-RIGHT: 10px; FLOAT: right; COLOR: #3867af; FONT-FAMILY: Verdana}
.cvBoxBody {WIDTH: 100%; BACKGROUND-COLOR: #ffffff}
#table_info td {height:60px;}
.tdone{text-align:right;}
.tdtwo{text-indent:10px;}
a.re_error {width:175px; height:20px;color: red; padding:0 3px;margin-left:10px; line-height:21px; background:url(../images/file/error.gif) no-repeat;cursor:pointer;float:left; }
input.error, textarea.error, select.error { border-color:#FB7E81 #FB7E81 #FB7E81 #FB7E81;background:url(../images/file/invalid_line.gif) bottom repeat-x;}
.popup_container{border:3px #E1E1E1 solid;text-align:left;font-family:Geneva, Arial, Helvetica, sans-serif;z-index:50;padding:5px}
.popup_container .popup_main{border:1px solid #A7A6A6;background:#FFF;color:#3F3F3F;word-wrap:break-word;word-break:break-all;overflow:hidden;width:310px}
.popup_container .popup_main .popup_title{width:100%;height:28px!important;line-height:28px!important;background:#F1F1F1;border-bottom:1px solid #DEDEDE;cursor:move}
.popup_container .popup_main .popup_title h3{font-size:14px;float:left;height:28px!important;line-height:28px!important;text-indent:0!important;margin:0 auto}
.popup_container .popup_main .popup_title button{background:url(../images/file/pop_close.png) no-repeat;width:17px;height:17px;float:right;border:0;cursor:pointer;margin:5px 5px 0 0}
.popup_container .popup_main .popup_title button:hover{background-position:-19px 0}
.popup_container .popup_main .popup_container_tips{margin:20px 20px 0}
.popup_container .popup_main .global_tip_button{height:41px;width:100%;background:#F1F1F1;border-top:1px solid #E9E9E9;text-align:center;position:relative}
.popup_container .popup_main .global_tip_button button{margin-right:10px;line-height:21px;margin-top:10px;text-align:center}
.popup_container .popup_main .alert{background:url(statics/info.gif) no-repeat}
.popup_container .popup_main .confirm{background:url(statics/important.gif) no-repeat}
.popup_container .popup_main .prompt{background:url(statics/help.gif) no-repeat}
.popup_container .popup_main .gb_tips{font-size:12px!important;text-align:left;margin:0!important;padding:0 0 10px 50px}
.popup_container .popup_main .gb_tips p{line-height:21px;font-size:12px!important;margin:0 0 15px}
.prompt_txt{border:1px solid #A7A6AA;width:220px;height:19px}
.prompt_err{display:none;background:#fffaea url(statics/erroralert.gif) no-repeat 8px center;_padding-top:4px;border:1px solid #ffe591;font-size:12px;padding:3px 20px 4px 34px}
</style>

<script type="text/javascript">
var web_type = '<{$web_type}>';

function public_js()
{
  if($('#products_id').val().replace(/(^\s*)|(\s*$)/g, "")=="")
  {
      alert('产品不能为空！');
      $("#products_id").focus();
      return false;
  }
  if($('#giveaway').attr("checked")==1)
  {
	  if($('#getcodeurl').val().replace(/(^\s*)|(\s*$)/g, "")=="")
	  {
		  alert('getcodeurl不能为空！');
		  $("#getcodeurl").focus();
		  return false;
	  }
  }
  return true;
}

function check_submit()
{  
	if($('#act').val() == 'add')
	{
		if(public_js())
		{
			return true;
		}else
		{
			return false;
		}
	}else
	{
		if(!public_js())
		{
			return false;
		}
		var products_id = $('#hidden_products_id').val();
		var strs = new Array(); //定义一数组
		var str_recommended = '';
		str_recommended = $('#h_recommended_product').val();
		
		if(str_recommended != "")
		{
			strs = str_recommended.split(",");
			
			if(in_array(products_id,strs))
			{
				alert('底部推荐产品里不能含有你所修改的产品，请重新选择！');
				return false;
			}
		}
		if($('#h_high_product').val().replace(/(^\s*)|(\s*$)/g, "")!="")
		{
			if($('#h_high_product').val() == products_id )
			{
				alert('推荐的高版本产品不能为你所修改的产品，请重新选择！');
				return false;
			}
		}
		return true;
	}
}

function high_button(type)
{
	if(type == 'show')
	{
		$('#get_info3').show(); 
	}else if(type == 'hide')
	{
		$('#get_info3').hide(); 
	}
}

//根据不同站隐藏不同表单项
$(function(){
	if( web_type == '1' ){//ws
		var hide_arr = ['p_ad_guide','p_overview_desc','p_overview_img','p_overview_append','p_screenshots'];
	}else if( web_type == '8' ){//iskysoft
		var hide_arr = ['p_recomment','p_adv','p_awards_img','p_giveaway','p_getcode','p_overview_desc','p_overview_img','p_overview_append','p_screenshots']
	}else if( web_type == '2' ){//aimersoft
		var hide_arr = ['p_adv','p_giveaway','p_getcode']
	}else{
		var hide_arr = [];	
	}
	
	for( var i in hide_arr ){
		$("#"+hide_arr[i]).hide();	
	}
})

</script>
</head>
<body   onload="create()">
<h1>
<span class="action-span">
<a href="/wondershare/products.php?action=index&web_type=<{$web_type}>">产品列表</a>
</span>
<span class="action-span1">
<a href="/wondershare/products.php?action=index&web_type=<{$web_type}>"><{$web_info}>网站产品信息</a> >  <a href="/wondershare/category.php?action=index&type=2&w_type=<{$web_type}>">产品分类列表</a>
</span>
<span id="search_id" class="action-span1"> > 产品<{$tile}> </span>
<div style="clear:both"></div>
</h1>



<div id="tabbar-div">
	<p  id="tab_info">
        <span id="general-tab" class="tab-front" >产品页面信息</span>
		<{foreach from=$product_info.data_page item=data}> <span id="attributes<{$data.article_id}>-tab" class="tab-back"> <{$data.name}> </span>  <{/foreach}>
      </p>
    </div>
<div id="tabbody-div"  style=" width:1100px;" >
      <form  name="theForm" method="post" action="/wondershare/products.php?action=index&web_type=<{$web_type}>" enctype="multipart/form-data"
	   onsubmit="return check_submit();">
        <!-- 最大文件限制 -->
        <input type="hidden" value="2097152" name="MAX_FILE_SIZE">
        <!-- 通用信息 -->
        <table align="center" width="90%" id="general-table">
          <tbody>
		  <{if $form_act == 'add'}>
		  <tr>
            <td class="label">*产品：</td>
            <td><input type="text" size="57" style="float:left;;" value="<{$product_info.id}>" name="products_id" id="products_id" disabled="disabled">
			<input type="button" value="选择产品"   name="get_info1" style="margin-left:10px;" onclick="getproductlist('products_id');" />
			<input type="hidden" name="hidden_products_id"  id="hidden_products_id"/>
			</td>
          </tr>
		  <{else}>
		  <tr>
            <td class="label">*产品：</td>
            <td>
			<span style="color:#FF0000"><b><{$product_info.product_name|escape}></b></span>
			</td>
          </tr>
		  <{/if}>
		  <tr>
            <td class="label">*产品分类：</td>
            <td>
			<select name="parent_id" id="parent_id" style="width:220px;" >
			<option value="0">无</option>
             <{$cat_select}>
			 </select>
            </td>
          </tr>
		  
		  <tr>
            <td class="label">产品标签：</td>
            <td>
			<{$all_tag}>
            </td>
          </tr>
           <tr>
            <td class="label">产品重要级别：</td>
            <td>
			<input type="radio" name="emphasis" value="0" <{if $product_info.is_emphasis == 0}> checked="checked"  <{/if}>/>次要
			 <input type="radio" name="emphasis" value="1"  style="margin-left:30px;" <{if $product_info.is_emphasis == 1}> checked="checked"  <{/if}>/>重要
            </td>
          </tr>
		  
		  <tr>
            <td class="label">*<{$web_info}>头部配图路径：</td>
            <td><input type="text" size="57" style="float:left;;" value="<{$product_info.top_image|escape}>" name="top_image" id="top_image" >
           
            </td>
          </tr>
		  
		<tr>
            <td class="label">添加Samples等页面：</td>
            <td>
			<input type="text" size="57"  value="<{if $form_act == 'add'}> 不可用 <{else}><{$product_info.attributes_name|escape}><{/if}>" name="w_attributes_id" id="w_attributes_id" disabled="disabled">
			<input type="hidden"   name="w_attributes_str" id="w_attributes_str" value="<{$product_info.won_attributes_id}>">
			<input type="hidden"   name="w_attributes_original" id="w_attributes_original" value="<{$product_info.won_attributes_id}>">
			<a id="A4" href="javascript:void(0);" style="margin-left:20px;"><{$tile}>页面</a>
            </td>
          </tr>
		  
		   <tr id="p_recomment">
            <td class="label">底部推荐产品：</td>
            <td>
			<textarea name="recommended_product" id="recommended_product" size="50"  style="width:400px; height:100px; float:left; 
			margin-top:10px; "  disabled="disabled"/> <{$product_info.recommended_name|escape}></textarea>
            <input type="button" value="选择产品"   name="get_info2" style="margin-left:20px; margin-top:10px; " 
			onclick="getproductlist('recommended_product');" />
			<input type="hidden" id="h_recommended_product"  name="h_recommended_product"   value="<{$product_info.recommended_product}>"/>
			<!--<input type="hidden" id="original_recommended_product"  name="original_recommended_product"  
			value="<{$product_info.recommended_product}>"/>     
			    
			<input type="hidden" id="original_recommended_product_name"  name="original_recommended_product_name"   
			value="<{$product_info.recommended_name}>"/>-->
			</td>
          </tr> 
		  
		  <tr>
            <td class="label">是否高低版本：</td>
            <td>
			<input type="radio" name="is_high_version" value="0"  <{if $product_info.is_high_version == 0 }> checked="checked" <{/if}>  onclick="high_button('hide');"/>无 
			<input type="radio" name="is_high_version" value="1"  style="margin-left:30px;" <{if $product_info.is_high_version == 1 }> checked="checked" <{/if}>   onclick="high_button('hide');"/>高版本
			<input type="radio" name="is_high_version" value="2"  style="margin-left:30px;"  <{if $product_info.is_high_version == 2 }> checked="checked" <{/if}>  onclick="high_button('show');"/>中版本
			<input type="radio" name="is_high_version" value="3"  style="margin-left:30px;"  <{if $product_info.is_high_version == 3 }> checked="checked" <{/if}>  onclick="high_button('show');"/>低版本
            </td>
          </tr>
		  
		   <tr>
            <td class="label">请选择推荐的高版本产品：</td>
            <td><input type="text" size="57" style="float:left;;"  disabled="disabled" value="<{$product_info.high_product_name}>" name="high_product" id="high_product" >
			<input type="button" value="选择产品"   name="get_info3" id="get_info3" style="margin-left:20px;<{if $product_info.is_high_version == 0 || $is_high_version == 1 }> display:none<{/if}>" onclick="getproductlist('high_product');"/>
			<input type="hidden" name="h_high_product" id="h_high_product" value="<{$product_info.high_product}>"/>
			
			<!--<input type="hidden" name="original_high_product" id="original_high_product" value="<{$product_info.high_product}>"/>
			
			<input type="hidden" id="original_high_product_name"  name="original_high_product_name"   
			value="<{$product_info.high_product_name}>"/>-->
			
			</td>
          </tr>
		  
		    <tr id="p_adv">
            <td class="label">产品目录页Your advantages内容：</td>
            <td>
			<textarea name="advantages_content" size="50"  style="width:400px; height:100px;" /><{$product_info.advantages_content|escape}> </textarea>
            </td>
          </tr>
		  	  
		  <tr>
            <td class="label">侧边关联Tips：</td>
            <td>
			<textarea name="p_tips" size="50"  style="width:400px; height:100px;" /><{$product_info.tips|escape}> </textarea>
            </td>
          </tr>
		  
		   <tr id="p_awards_img">
            <td class="label">侧边Awards图片路径：</td>
            <td><input type="text" size="57" style="float:left;" value="<{$product_info.awards_image|escape}>" name="awards_image" id="awards_image">
		
			</td>
          </tr>
          <tr id="p_giveaway">
            <td class="label">是否giveaway：</td>
            <td><input type="checkbox" style="float:left;" value="1" name="giveaway" id="giveaway" <{ if $product_info.giveaway eq 1}> checked="checked" <{/if}> />
			</td>
          </tr>
          <tr id="p_getcode">
            <td class="label">getcode URL：</td>
            <td><input type="text" size="57" style="float:left;" value="<{$product_info.getcodeurl|escape}>" name="getcodeurl" id="getcodeurl">
			</td>
          </tr>
		  
		   <tr>
            <td class="label">侧边其他模块选择：</td>
            <td>
			<input type="text" size="57"  value="<{if $form_act == 'add'}> 不可用 <{else}><{$product_info.bar_name|escape}><{/if}>" name="overview_bar" id="overview_bar" disabled="disabled">
			<input type="hidden"   name="overview_bar_str" id="overview_bar_str"  value="<{$product_info.won_overview_bar}>">
			<a id="overview_bar_A3" href="javascript:void(0);" style="margin-left:20px;">选择关联模块</a>
			
            </td>
          </tr>
          
		   <tr id="p_ad_guide">
            <td class="label">广告引导语：</td>
            <td>
			<input type="text" size="57"  value="<{$product_info.ad_guide|escape}>" name="ad_guide"></td>
          </tr>
          
          <tr id="p_overview_desc">
            <td class="label">Overview描述：</td>
            <td><textarea name="overview_desc" style="width:400px; height:100px;"><{$product_info.overview_desc|escape}></textarea></td>
          </tr>
          
          <tr id="p_overview_img">
            <td class="label">Overview图片：</td>
            <td>
			<input type="text" size="57"  value="<{$product_info.overview_img|escape}>" name="overview_img"></td>
          </tr>
          
          <tr id="p_overview_append">
            <td class="label">Overview附加：</td>
            <td><textarea name="overview_append" style="width:400px; height:100px;"><{$product_info.overview_append|escape}></textarea></td>
          </tr>
          
          <tr id="p_screenshots">
            <td class="label">Screenshots图片：</td>
            <td><input type="text" size="57"  value="<{$product_info.screenshots|escape}>" name="screenshots"></td>
          </tr>
          
        </tbody></table>

   
		
	
		
		<{foreach from=$product_info.data_page item=data}> 
		<table width="90%" style="display:none" id="attributes<{$data.article_id}>-table">
		<tbody> 
		<tr>
		<td>页面标题</td>
		<td>
		<input type="text" size="70"  value="<{$data.page_title|escape}>"  name="page_title<{$data.article_id}>" >
		</td>
		</tr>
		
		 <tr>
		 <td>页面内容</td>
		 <td>
		 <textarea name="page_content<{$data.article_id}>" size="50"  />  <{$data.page_content}> </textarea>
		 </td>
		 </tr>
		 </tbody>
		 </table>
		<{/foreach}>
		
        <div  style="margin-left:380px; margin-top:20px;" id="submit_div">
          <{if $form_act == 'edit'}> <input type="hidden"  name="ws_id"  id="ws_id" value="<{$product_info.id}>">

		   <{/if}>
          <input type="submit"   class="button" value="<{$tile}> " name="sub_from">
          <input type="reset" class="button" value=" 重置 ">
        </div>
        <input type="hidden"  id="web_type" value="<{$web_type}>" name="web_type" >
        <input type="hidden"  id="web_info" value="<{$web_info}>" name="web_info" >
        <input type="hidden"  id="act" value="<{$form_act}>" name="act" >
        <input type="hidden" id="is_review" value="0" name="is_review" />
      </form>
    </div>
	
<div class="A4Demo" style="display: none; width: 550px; padding: 10px;"  id="A4Demo">
<div id="A4Demo2">
       <{$all_attributes}><br />
       <label><input type="checkbox" <{if $product_info.is_review}>checked="checked"<{/if}> onclick="isReview(this)" /> 是否有评论</label>
	   <input type="button"    value="确定" name="check_attributes"  onclick="select_attributes('A4Demo2')" style="margin-top:20px; margin-left:200px;">
	   
    </div>
</div>

<div class="A4Demol0" style="display: none; width: 550px; padding: 10px;"  id="A4Demol0">
<div id="A3Demo0">
       <div id="info"><{$all_bar}></div><br />
	   <input type="button"    value="确定" name="check_attributes"  onclick="select_bar('overview_bar','A3Demo0')" style="margin-top:20px; margin-left:200px;">  
    </div>
</div>


<script type="text/javascript">// <![CDATA[
var str_attr = '';
var strs = '';
str_attr = $('#w_attributes_str').val();
if(str_attr!='')
{
 strs = str_attr.split(",");
 $.each(strs, function(key, value)
 { 
  create_FCKedito('page_content'+value);
  var  str2 = value;
  create_bar_div(str2); 
   
 });
}

$("#A4").click(function()
 {
    $(".A4Demo").cvbox(
	{
       titleBarText: "选择页面属性"
    });
    $('#A4Demo2').show();
 });
	
 var arr = ['overview_bar'];
 $.each(arr, function(key, value)
 { 

   $("#"+value+'_A3').click(function() 
   {
	 select_checkbox('bar',value+'_str');
	$('#A3Demo'+key).show();
	$(".A4Demol"+key).cvbox(
	{
      titleBarText: "选择页面右侧块"
    });
		 
   });
 }); 
 
 //note 是否有评论
function isReview( obj ){
	var i = 0;
	if( $( obj ).attr('checked') ){
		$("#is_review").val(1);
		i = 1;
	}else{
		$("#is_review").val(0);	
		i = 0;
	}
	
	$.get('product_review.php?action=set_review&pid=<{$product_info.id}>&pname=<{$product_info.product_name}>&is_review='+i+'&web_type=<{$web_type}>');
}

</script>
	
</body>
</html>